import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store/index'
import axios from 'axios'

// 默认是get请求方式
const request = axios.create({
  timeout: 5000,
})

Vue.prototype.$request = request

Vue.filter('formatTime', function(val) {
  // 时间戳是毫秒数
  let minute = parseInt(val / 1000 / 60)
  if (minute < 10) {
    minute = '0' + minute
  }
  let second = parseInt((val / 1000) % 60)
  if (second < 10) {
    second = '0' + second
  }
  return minute + ':' + second
})

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store,
}).$mount('#app')
